﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>    


		<head>
		<script type="text/javascript" src="<c:url value='/easyui/datagrid-detailview.js?r=c'/>"></script>
		<script type="text/javascript">
		var twice = ${cfgs["fontsizetwice"]};
		var fontsize = 12;
		var lineheight = 18;
		
		function dgfontsizechange(){
			if (twice > 1){
				
				$(".datagrid-row .datagrid-cell").css("font-size", fontsize*twice+ "px");
				$(".datagrid-row .datagrid-cell").css("line-height", lineheight*twice + "px");

				$(".datagrid-row-detail").css("font-size", fontsize*twice+ "px");
				$(".datagrid-row-detail").css("line-height", lineheight*twice + "px");
				
				
				$(".datagrid-cell-rownumber").css("font-size", fontsize*twice + "px");
				$(".datagrid-cell-rownumber").css("height", lineheight*twice + "px");
				$(".datagrid-cell-rownumber").css("line-height", lineheight*twice + "px");
	      
				$(".datagridview-td-div").css("width", "50px");
				
				$('.datagrid div').each(function(i){
					   var classname = $(this).attr('class');
					   if  ((classname != undefined) && (classname.indexOf('datagrid-')!=-1)){
					   	    var newwidth = $(this).attr("oldwidth");
					   	    
					   	    if (newwidth == undefined) {				   	    	
	                    newwidth = $(this).css("width");
	                    $(this).attr("oldwidth",newwidth);
	                    
	                }
	                
	                var newwidth = parseFloat(newwidth) * twice;
	                if (newwidth > 0)
					   	    $(this).css('width',newwidth);
					   	}
					   	
	    		});
				
				$('#cc').layout();  
			}
			}
		
			$(function(){
				  init();
			  
			});

			function init(){
				$('#t-dg').datagrid({
				loadMsg:'',		
				onLoadSuccess:function(data){
					dgfontsizechange();											
					},
				view:detailview,
				onDblClickRow:function(rowIndex, rowData){
					$('#t-dg').datagrid('expandRow',rowIndex);
                },
				detailFormatter:function(index,row){
				  var content = '';
          
          content += '<span style="color:blue;font-weight:700">方式：</span></br>';
content += '<div style="padding:5px">'+ row.op_mode.replace(/\r\n/gi,'<br/>')+'</div>';
content += '<span style="color:blue;font-weight:700">类型：</span></br>';
content += '<div style="padding:5px">'+ row.op_type.replace(/\r\n/gi,'<br/>')+'</div>';

          
          if (row.unitname)  {
   content += '<span style="color:blue;font-weight:700">单位名称：</span></br>';
   content += '<div style="padding:5px">'+ row.unitname.replace(/\r\n/gi,'<br/>')+'</div>';
}
if (row.editdate)  {
   content += '<span style="color:blue;font-weight:700">录入时间：</span></br>';
   content += '<div style="padding:5px">'+ row.editdate.replace(/\r\n/gi,'<br/>')+'</div>';
}
if (row.valid_time_hint)  {
   content += '<span style="color:blue;font-weight:700">过期时间：</span></br>';
   content += '<div style="padding:5px">'+ row.valid_time_hint.replace(/\r\n/gi,'<br/>')+'</div>';
}
if (row.address)  {
   content += '<span style="color:blue;font-weight:700">地址：</span></br>';
   content += '<div style="padding:5px">'+ row.address.replace(/\r\n/gi,'<br/>')+'</div>';
}

if (row.mj)  {
	   content += '<span style="color:blue;font-weight:700">面积：</span></br>';
	   content += '<div style="padding:5px">'+ row.mj.replace(/\r\n/gi,'<br/>')+'</div>';
	}
	if (row.tx)  {
	   content += '<span style="color:blue;font-weight:700">套型：</span></br>';
	   content += '<div style="padding:5px">'+ row.tx.replace(/\r\n/gi,'<br/>')+'</div>';
	}
	if (row.lc)  {
	   content += '<span style="color:blue;font-weight:700">楼层：</span></br>';
	   content += '<div style="padding:5px">'+ row.lc.replace(/\r\n/gi,'<br/>')+'</div>';
	}
	if (row.jg)  {
	   content += '<span style="color:blue;font-weight:700">价格：</span></br>';
	   content += '<div style="padding:5px">'+ row.jg.replace(/\r\n/gi,'<br/>')+'</div>';
	}
	if (row.zx)  {
	   content += '<span style="color:blue;font-weight:700">装修：</span></br>';
	   content += '<div style="padding:5px">'+ row.zx.replace(/\r\n/gi,'<br/>')+'</div>';
	}
	if (row.lxfs)  {
	   content += '<span style="color:blue;font-weight:700">联系方式：</span></br>';
	   content += '<div style="padding:5px">'+ row.lxfs.replace(/\r\n/gi,'<br/>')+'</div>';
	}
if (row.context)  {
   content += '<span style="color:blue;font-weight:700">内容：</span></br>';
   content += '<div style="padding:5px">'+ row.context.replace(/\r\n/gi,'<br/>')+'</div>';
}
if (row.memo)  {
   content += '<span style="color:blue;font-weight:700">备注：</span></br>';
   content += '<div style="padding:5px">'+ row.memo.replace(/\r\n/gi,'<br/>')+'</div>';
}
if (row.oper)  {
   content += '<span style="color:blue;font-weight:700">操作人员：</span></br>';
   content += '<div style="padding:5px">'+ row.oper.replace(/\r\n/gi,'<br/>')+'</div>';
}

           
					return '<div style="padding:5px">' + content + '</div>';
				}
				
			});
				
			}
			
			
			

			
			
			
			
			function doQuery(value){
				$('#t-dg').datagrid('load', {
					q: value
				});
			}
			
		</script>
	</head>
	<body>
		<div class="easyui-layout" fit="true">
			<div region="north" border="false" style="height:40px;padding:5px;overflow:hidden;">
			<div style="padding-top:3px;float:left">
			<input class="easyui-searchbox" prompt="按地址|内容进行查询" searcher="doQuery" style="width:300px"></input>
  		</div>
		
	</div>
			
			
			<div region="center" border="true">
	      <table id="t-dg" style="display:none;"
						url="<c:url value='/read/Demandinfo/getDemandinfoItems'/>"
						singleSelect="true" rownumbers="true" pagination="true"
						border="false" fit="true" >
					<thead>
						<tr>
							<th field="unitname" width="100" sortable="true">单位名称</th>
<th field="editdate" width="100" sortable="false">录入时间</th>
<th field="op_mode" width="100" sortable="true" >方式</th>
<th field="op_type" width="100" sortable="true" >类型</th>
<th field="valid_time_hint" width="100" sortable="false">过期时间</th>
<th field="address" width="100" sortable="true">地址</th>
<th field="mj" width="100" sortable="true">面积</th>
<th field="tx" width="100" sortable="true">套型</th>
<th field="lc" width="100" sortable="true">楼层</th>
<th field="jg" width="100" sortable="true">价格</th>
<th field="zx" width="100" sortable="false">装修</th>
<th field="lxfs" width="100" sortable="false">联系方式</th>
<th field="context" width="100" sortable="false">内容</th>
<th field="memo" width="100" sortable="false">备注</th>
<th field="oper" width="100" sortable="true">操作人员</th>

						</tr>
					</thead>
				</table>			
			</div>
		</div>
		
		
		
			
		
		
		
		
	</body>
